home *** CD-ROM | disk | FTP | other *** search
-
-
-
- PIPE C Library Procedures PIPE
-
-
-
- NNAAMMEE
- pipe - create an interprocess communication channel
-
- SSYYNNOOPPSSIISS
- ppiippee((ffiillddeess))
- iinntt ffiillddeess[[22]];;
-
- DDEESSCCRRIIPPTTIIOONN
- The _p_i_p_e system call creates an I/O mechanism called a pipe.
- The file descriptors returned can be used in read and write
- operations. When the pipe is written using the descriptor
- _f_i_l_d_e_s[1] up to 4096 bytes of data are buffered before the
- writing process is suspended. A read using the descriptor
- _f_i_l_d_e_s[0] will pick up the data.
-
- It is assumed that after the pipe has been set up, two (or
- more) cooperating processes (created by subsequent _f_o_r_k
- calls) will pass data through the pipe with _r_e_a_d and _w_r_i_t_e
- calls.
-
- The shell has a syntax to set up a linear array of processes
- connected by pipes.
-
- Read calls on an empty pipe (no buffered data) with only one
- end (all write file descriptors closed) returns an end-of-
- file.
-
- Pipes are really a special case of the _s_o_c_k_e_t_p_a_i_r(2) call
- and, in fact, are implemented as such in the system.
-
- A signal is generated if a write on a pipe with only one end
- is attempted.
-
- RREETTUURRNN VVAALLUUEE
- The function value zero is returned if the pipe was created;
- -1 if an error occurred.
-
- EERRRROORRSS
- The _p_i_p_e call will fail if:
-
- [EMFILE] Too many descriptors are active.
-
- [ENFILE] The system file table is full.
-
- [EFAULT] The _f_i_l_d_e_s buffer is in an invalid area of
- the process's address space.
-
- SSEEEE AALLSSOO
- sh(1), read(2), write(2), fork(2), socketpair(2)
-
- BBUUGGSS
- Should more than 4096 bytes be necessary in any pipe among a
-
-
-
- Sprite v1.0 August 26, 1985 1
-
-
-
-
-
-
- PIPE C Library Procedures PIPE
-
-
-
- loop of processes, deadlock will occur.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v1.0 August 26, 1985 2
-
-
-
-